name: Sync Readme to Docker Hub

on:
  push:
    branches:
      - main
    paths:
      - readme.md
      - .github/workflows/sync-dockerhub-readme.yml

jobs:
  sync:
    name: Sync
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Sync Readme to Docker Hub
        uses: peter-evans/dockerhub-description@v4
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_PASSWORD }}
          readme-filepath: ./readme.md
